package com.example.demo1.controller;

import com.example.demo1.Entity.Student;
import com.example.demo1.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class StudentController {

    @Autowired
    private StudentService studentService;
    @PostMapping("/Student")

    public void inputStudent(@RequestParam long studentid,
                             @RequestParam String studentname,
                             @RequestParam String studentsex,
                             @RequestParam String clas,
                             @RequestParam String studentinformation,
                             @RequestParam long courseid,
                             @RequestParam String coursename
                            ){
        Student student=studentService.StudentSet(studentid,studentname,studentsex,clas,studentinformation,courseid,coursename);
        studentService.save_data(student);
    }
}
